﻿using NewsPortal.Domain.Layout;
using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NewsPortal.DataAccess.POCO.Config
{
    public class PageConfiguration: EntityTypeConfiguration<Page>
    {
        public PageConfiguration()
        {
            this.HasKey(p => p.Id);
            this.HasMany(p => p.Grids).WithRequired(g => g.Page).HasForeignKey(g => g.PageId);
        }
    }
}
